package com.yfqy.admin.conf.redis;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;

@Data
@Component
@ConfigurationProperties(prefix = "admin-redis")
public class RedissonProperties {
    private Basics basics;
    private Single single;
    private Cluster cluster;

    @Data
    public static class Basics {
        // single/cluster/sentinel/master-slave
        private String model;
        private String password;
        private int timeout;
        private int connectionPoolSize;
        private int connectionMinimumIdleSize;
    }

    @Data
    public static class Single {
        private String address;
        private int database;
    }

    @Data
    public static class Cluster {
        private List<String> address;
        // 其他集群专用配置可以继续添加
        // private int scanInterval;
        // private int slaveConnectionMinimumIdleSize;
    }
}
